package com.itheima.homework01;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class PropertiesDemo {
    public static void main(String[] args) throws IOException {
        // 1、创建Properties对象出来，先用它存储一些键值对数据
        Properties pro = new Properties();
        pro.setProperty("brand","Iphone11pro max");
        pro.setProperty("capacity","256G");
        pro.setProperty("price","10899");

        // 2、把properties对象中的键值对数据存入到属性文件中去
        pro.store(new FileWriter("iphone.properties"),"苹果手机信息");

    }
}
